<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>

</body>
<script>
    let sum = (...b) => {
        if (b.length === 2) {
            b.reduce((a, b) => {
                console.log(a + b)
            })
        } else {
            let sum1 = (a) => {
                console.log(b.join() * 1 + a)
            }
            return sum1
        }
    }
    sum(2, 3)
    sum(2)(3)



    let arr = [10, 5, 11, 7, 8, 9]
    let arrfn = (arr) => {
        let app = arr.sort((a, b) => {
            return a - b;
        })
        console.log(`最小值是:${app[0]}, 最大值是:${app[app.length - 1]} 最大差值是:${app[app.length - 1]-app[0]}`)
    }
    arrfn(arr)
</script>

</html>